/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.utp.soft6.model;

import org.hibernate.Session;
import org.hibernate.Transaction;

import com.utp.soft6.model.enteties.Cliente;

/**
 *
 * @author JOSE
 */
public class ClienteDAO {
    
	private Session session;
	
    public ClienteDAO(Session session) {
    	 this.session = session;
    }
    
   

	public long createCliente(Cliente cliente) {
    	long clienteId = -1;
    	Transaction tx = null;
    	try {
    	tx = session.beginTransaction();
    	clienteId = (Long)session.save(cliente);
    	tx.commit();
    	} catch (Exception e) {

    	e.printStackTrace();
    	}
    	return clienteId;
    	}
 
}
